/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx.mapper;

import cn.webrx.entity.Carousel;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.Calendar;
import java.util.List;
import java.util.Map;

/**
 * <p>Project: ssmapp - CarouselMaper
 * <p>Powered by webrx On 2022-04-01 17:36:28
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */

@Service
public interface CarouselMaper {
    @Select("select * from t_carousel")
    public List<Carousel> queryAll();

    @Select("select * from t_carousel where isshow")
    public List<Carousel> show();

    @Update("update t_carousel set isshow=#{v} where id=#{id}")
    public int updateIsShow(@Param("v") int v,@Param("id") int id);

    @Delete("delete from t_carousel where id = #{id}")
    public int deleteById(int id);

    @Insert("insert into t_carousel(title,link,src,isshow) value(#{title},#{link},#{src},#{isshow})")
    public int save(Map<String,Object> map);

}
